package com.xianggu.designMode.stateMethod.impl;

import com.xianggu.designMode.stateMethod.PlayerState;
import com.xianggu.designMode.stateMethod.context.PlayerContext;

/**
 * 暂停中状态：可恢复播放或停止播放
 */
class PausedState implements PlayerState {
    @Override
    public void play(PlayerContext context) {
        System.out.println("[暂停中] 恢复播放");
        context.setState(new PlayingState()); // 切换到播放状态
    }

    @Override
    public void pause(PlayerContext context) {
        System.out.println("[暂停中] 已经是暂停状态");
    }

    @Override
    public void stop(PlayerContext context) {
        System.out.println("[暂停中] 停止视频");
        context.setState(new StoppedState()); // 切换到停止状态
    }
}